package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.admin.StoreSaleListAndPageDto;
import com.frejoys.common.dto.store.StoreSaleListDto;
import com.frejoys.common.vo.admin.StoreStatisticsListVo;
import com.frejoys.common.vo.store.StoreStatisticsMonthVo;
import com.frejoys.dao.entity.StoreStatisticsMonth;

import java.util.List;

public interface StoreStatisticsMonthService extends IService<StoreStatisticsMonth> {

    default StoreStatisticsMonth getOnly(QueryWrapper<StoreStatisticsMonth> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default StoreStatisticsMonth getOnly(LambdaQueryWrapper<StoreStatisticsMonth> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    /**
     * 获取商家店铺统计
     */
    List<StoreStatisticsMonthVo> getList(StoreSaleListDto dto,Long userId);


    //管理员查询店铺销售月统计列表
    IPage<StoreStatisticsListVo> storeStatisticsMonthList(StoreSaleListAndPageDto dto);
}
